Vue.filter('reverse', function (value) {
    if(value == undefined){
        return 0;
    }else{
        return value;
    }
})
var v = new Vue({
    el:"#home",
    data:{
        vdata:{},
        money:{},
        fishWeight:""
    },
    methods:{
        getSales:function(){
            var _this = this;
            $.get(
                "/index.php/Order/getSalesOneDay",
                function(ret) {
                    if (ret.status == "success") {
                        _this.money = ret.data;
                        //console.log(_this.MoneyInfo.amount);
                    } else {
                        layer.msg("今天还没有销售记录!",{icon:2});
                    }
                }
            );
        },
        getFishWeight:function(){
            var _this = this;
            $.get(
                "/index.php/Order/getAllSpeciesNumOneDay",
                function(ret) {
                    if (ret.status == "success") {
                        _this.fishWeight = ret.data;
                        //console.log(_this.MoneyInfo.amount);
                    } else {
                        //layer.msg("还没有记录!",{icon:2});
                    }
                }
            );
        }
    },
    ready: function() {
        this.getSales();
        this.getFishWeight();
    }
});